﻿CREATE PROCEDURE [dbo].[yaf_forum_listall_fromcat](
                @BoardID    INT,
                @CategoryID INT)
AS
    BEGIN
        SELECT   b.CategoryID,
                 b.Name       AS Category,
                 a.ForumID,
                 a.Name       AS Forum,
                 a.ParentID
        FROM     yaf_Forum a
                 INNER JOIN yaf_Category b
                   ON b.CategoryID = a.CategoryID
        WHERE    b.CategoryID = @CategoryID
        AND b.BoardID = @BoardID
        ORDER BY b.SortOrder,
                 a.SortOrder
    END


